import React from 'react';
//import logo from './logo.svg';
import './App.css';
import Home from './pages/home';
//import Login from './pages/login/index'
//import Detail from './pages/login/detail/index'
//import NotFound from './pages/notfound/index'
// import Link from './router/index'
//import Admin from './pages/admin/admin'
//import Demo from './pages/demo/index'
import {adminRoutes}from './router/routers'
 //import { createBrowserHistory } from "history";
import {BrowserRouter ,Route,Switch,Redirect} from 'react-router-dom'
//import 'antd/dist/antd.css';
class App extends React.Component{
  // constructor(props){
  //   super(props)
  // }
  render(){
    //console.log(this.props.location.pathname)
    return (
      <BrowserRouter>
     {/* <Router > */}
     <Home>
      
      <Switch>
       
        {adminRoutes.map(route=>{
          return < Route key={route.path} path={route.path} exact={route.exact} strict render={routeProps=>{
            return < route.component {...routeProps}/>
          }}/>
        })}
        <Redirect to="/echarts" />
        {/* <Route path='/' component={Home} /> */}
      </Switch>
      
       </Home>
     {/* </Router> */}
       {/* <Route path='/' component={Home}/> */}
      </BrowserRouter>
    )
  }
}

export default App;
